#coding:utf-8
from django.shortcuts import render,render_to_response
from django.http import HttpResponseRedirect
from django.template import loader
from helloace.settings import EMAIL_HOST_USER
from django.core.mail import EmailMessage
from helloworld.models import Blog
import MySQLdb
def index(request):
    return render_to_response('index.html')

def loginview(request):
    #subject = "test"
    #html_content = '<html><body><h1>Hello World!</h1></body></html>'
    #send_html_mail(subject,html_content,['2310600021@qq.com'])
    #blog = Blog(title="hello",content="hello World")
    #blog.save()
    return render_to_response('login.html')

def send_html_mail(subject,html_content,recipient_list):
    msg = EmailMessage(subject,html_content,EMAIL_HOST_USER,recipient_list)
    msg.content_subtype = "html"
    msg.send()
